/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Platform;

/**
 *
 * @author HuuTri
 */
public class User {
    public String name;
    public String password;
    
    public User()
    {}
    
    public User(String name, String password)
    {
        this.name = name;
        this.password = password;
    }
    
    public String getName(){
       return this.name;
    }
    
    public void setName(String name){
        this.name = name;
    }
    
    public String getPassword(){
        return this.name;
    }
    
    public void setPassword(String password){
        this.password = password;
    }
    
    public String toString(){
        return name + " " + password;
    }

    public User convertFromString(String temp) {
        int index = temp.indexOf(' ');
        User user = new User();
        user.setName(temp.substring(index + 1));
        user.setPassword(temp.substring(0, index - 1));
        
        return user;
    }
}
